<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        #box{
            width: 200px;
            height: 100px;
            background-color: lightblue;
            margin-top: 200px;
            margin-left: 200px;
            position: absolute;
            z-index: -1;
        }
        #box::before{
            content: '';
            display: block;
            outline: 1px solid black;
            position: absolute;
            top: 50%;
            width: 100vw;
            left: -200px;
            transform: translateY(-50%);
        }
        #box::after{
            content: '';
            display: block;
            outline: 1px solid black;
            position: absolute;
            left: 50%;
            height: 100vh;
            transform: translateX(-50%);
            top: -200px;
        }
        #target{
            width: 40px;
            height: 40px;
            background-color: palegoldenrod;
            position: absolute;
            left: 400px;
            top: 100px;
            transform: translate(-50px,50px) scale(1);
        }
    </style>
</head>
<body>
    <div id="box"></div>
    <div id="target"></div>
    <script src="./coord.js"></script>
    <script>        

        const coordContext = createCoord(document.querySelector('#box'));
        const coordIns = coordContext(document.querySelector('#target'));
        const coord = coordIns.setCoord({x: 0, y: 0});
        console.log(coordIns.toRealCoord({x: 0, y: 0}), coordIns.getCoord());
    </script>
</body>
</html>